define(function(require,exports,module){
	
	var Subnav = require("subnav");
	
	module.exports = {
		initComponent: function(widget){
			var subnav = new Subnav({
				parentNode: ".J-subnav",
				model: {
					title: "产品批次",
					items: [{
						id: "search",
						type: "search",
						placeholder: "搜索（产品名称）",
						handler: function(str){
							widget.service.search({
								s: str,
								properties: "product.name",
								fetchProperties: "*,name,product.pkProduct,product.name"
							},function(ret){
								widget.get("grid").setData(ret);
							});
						}
					},{
						id: "seal",
						tip: "状态",
						type: "buttongroup",
						items: [{
							key: "false",
							value: "启用"
						},{
							key: "true",
							value: "停用"
						}],
						all: {
							show: true
						},
						handler: function(){
							widget.get("grid").refresh();
						}
					},{
						id: "add",
						type: "button",
						text: "新增",
						handler: function(){
							widget.get("form").reset();
							widget.toCard();
						}
					},{
						id: "return",
						type: "button",
						text: "返回",
						show: false,
						handler: function(){
							widget.toList();
						}
					}]
				}
			});
			widget.set("subnav",subnav);
		}
	}
});